package lumis.service.rss;

import java.util.Date;

import javax.servlet.jsp.el.ELException;
import javax.servlet.jsp.el.VariableResolver;

/**
 * Return the value for the specified variable 
 *
 * @version $Revision: 8618 $ $Date: 2007-12-18 11:34:20 -0200 (Tue, 18 Dec 2007) $
 * @since 4.1.0
 */
public class RssHeaderVariableResolver implements VariableResolver
{
	public Object resolveVariable(String variableName) throws ELException
	{
		Date date = new Date(System.currentTimeMillis()); 
		
		if ("publishedDate".equals(variableName))
			return date.toGMTString();
		else if("buildDate".equals(variableName))
			return date.toGMTString();
		
		throw new ELException("Unresolvable variable: " + variableName);
	}
}
